home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 443_01 / doc / info / cncl.info-5 < prev    next >
Encoding:
GNU Info File  |  1996-01-04  |  47.2 KB  |  1,648 lines

  1. This is Info file cncl.info, produced by Makeinfo-1.63 from the input
  2. file cncl.texi.
  3.  
  4.    This file documents the use of CNCL, the Communication Networks Class
  5. Library.
  6.  
  7.    Copyright (C) 1993-1996, Communication Networks.
  8.  
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.  
  13.    Permission is granted to copy and distribute modified versions of
  14. this manual under the conditions for verbatim copying, provided that the
  15. entire resulting derived work is distributed under the terms of a
  16. permission notice identical to this one.
  17.  
  18.    Permission is granted to copy and distribute translations of this
  19. manual into other languages, under the above conditions for modified
  20. versions.
  21.  
  22. 
  23. File: cncl.info,  Node: CNString,  Next: CNNamed,  Prev: CNICoord,  Up: Misc
  24.  
  25. CNString -- Character String
  26. ============================
  27.  
  28. SYNOPSIS
  29. --------
  30.  
  31.    `#include <CNCL/String.h>'
  32.  
  33. TYPE
  34. ----
  35.  
  36.    `CN_STRING'
  37.  
  38. * Menu:
  39.  
  40. BASE CLASSES
  41. ------------
  42. * CNObject::        Root of the CNCL Hierarchy
  43.  
  44. DERIVED CLASSES
  45. ---------------
  46.  
  47. RELATED CLASSES
  48. ---------------
  49. * CNNamed::            CNObject with Name
  50.  
  51. DESCRIPTION
  52. -----------
  53.  
  54.    `CNString' is a dynamic string manipulating class. Each `CNString'
  55. manages the string itself (stored as a normal C character string), the
  56. length of the string, and the allocated space.  The characters are
  57. indexed from 0 to length-1.
  58.  
  59.    Constructors:
  60.  
  61. `CNString();'
  62. `CNString(int extra);'
  63. `CNString(char c);'
  64. `CNString(char c, int extra);'
  65. `CNString(const char* cs);'
  66. `CNString(const char* cs, int extra);'
  67. `CNString(const CNString& s);'
  68. `CNString(const CNString& s, int extra);'
  69. `CNString(CNParam *param);'
  70.      Initializes the CNString. The `extra' parameter gives a hint as to
  71.      how many extra characters one expects the string to grow. Its
  72.      default value is 10.
  73.  
  74.    Destructors:
  75.  
  76. `~CNString();'
  77.      Deletes the CNString.
  78.  
  79.    In addition to the member functions required by CNCL, `CNString'
  80. provides:
  81.  
  82. `default_extra = 10;'
  83.      Default amount of additional storage allocated. Actually set to 10.
  84.  
  85. `void resize(unsigned i);'
  86.      Changes the capacity of the string either to its length plus
  87.      default_extra or to i, whichever is longer.
  88.  
  89. `void to_lower();'
  90.      Converts all characters in this string to lowercase.
  91.  
  92. `void to_upper();'
  93.      Converts all characters in this string to uppercase.
  94.  
  95. `void capitalize();'
  96.      Converts each first character of a word to uppercase, all other
  97.      characters to lowercase. A new word is either at the beginning of
  98.      the string or it starts with a space (e.g. "a.R fd" will be
  99.      capitalized to "A.r Fd").
  100.  
  101. `void strip_crlf();'
  102.      Removes '\r' and/or '\n' at end of string.
  103.  
  104. `void strip_lspace();'
  105. `void strip_rspace();'
  106. `void strip_space();'
  107.      Removes the left, the right or all white spaces of the string.
  108.  
  109. `unsigned capacity() const;'
  110.      Returns the amount of space allocated to this string.
  111.  
  112. `unsigned length() const;'
  113.      Returns the length of this string.
  114.  
  115. `CNString after(unsigned pos, unsigned l = 0) const;'
  116.      Returns the l characters of this string after position pos
  117.      (zero-based) as a string. The character at pos will be the first
  118.      character of the new string.  The default value l = 0 will return
  119.      all characters after pos.
  120.  
  121. `CNString before(unsigned pos, unsigned l = 0) const;'
  122.      Returns the l characters of this string before position pos (zero
  123.      based) as a string. The character at pos will be the last
  124.      character of the new string.  The default value l = 0 will return
  125.      all characters before pos.
  126.  
  127. `CNString& add(char c);'
  128. `CNString& add(const char* cs);'
  129.      Adds the character c or the character string cs to the end of this
  130.      string. If this string does not have enough space allocated it
  131.      will be changed automatically.
  132.  
  133. `CNString& del(unsigned pos = 0, unsigned l = 1);'
  134.      Deletes l characters beginning at position `pos' (zero based).
  135.      Default values are pos = 0 and l = 1 (e.g. a.del() will delete the
  136.      first character of string a). If l is set to 0 all characters
  137.      beginning at pos will be deleted (e.g. a.del(0,0) will delete all
  138.      characters in string a). Negative `pos' values count from end of
  139.      string.
  140.  
  141. `CNString& del(char c, int pos = 0);'
  142. `CNString& del(const char* cs, int pos = 0);'
  143. `CNString& del(const CNString& s, int pos = 0);'
  144.      Deletes character c, character string cs or string s at its first
  145.      occurence in this string after position pos (zero based, default
  146.      value pos = 0). It deletes nothing if c, cs or s is not in.
  147.  
  148. `CNString& insert(char c, int pos = 0);'
  149. `CNString& insert(const char* cs, int pos =0);'
  150. `CNString& insert(const CNString& s, int pos = 0);'
  151.      Inserts character c, character string cs or CNString s at position
  152.      pos (zero based, default value pos = 0).
  153.  
  154. `CNString& replace(char c, int pos = 0);'
  155.      Replaces the character at position pos (zero based, default value
  156.      pos = 0) with the character c.
  157.  
  158. `CNString& replace(const CNString& s, int pos = 0, int l = 0);'
  159.      Replaces the l characters starting at position pos (zero based,
  160.      default value pos = 0) with the characters of string s. Default
  161.      value l = 0 will replace as many characters as s.length(). The
  162.      capacity is changed to the needed space plus the default extra
  163.      value.
  164.  
  165. `CNString& replace(char oldc, char newc, int pos = 0);'
  166.      Replaces character oldc at its first occurence after position pos
  167.      (zero based, default value pos = 0) with newc. If oldc is not in
  168.      this string after pos nothing will be changed.
  169.  
  170. `CNString& replace(const CNString& olds, const CNString& news, int pos = 0);'
  171.      Replaces string olds at its first occurence after position pos
  172.      (zero based, default value pos = 0) with string news. If olds is
  173.      not in this string nothing will be changed.
  174.  
  175. `int downsearch(char c, int pos = 0);'
  176. `int downsearch(const CNString& s, int pos = 0);'
  177. `int downsearch(const char *cs, int pos = 0);'
  178.      Returns the last occurence of character c or string s in this
  179.      string before position pos (zero based, default value pos = 0) or
  180.      the end of this string if pos = 0 or pos >= len. If c or s is not
  181.      in this string before pos len is returned.
  182.  
  183. `int upsearch(char c, int pos = 0);'
  184. `int upsearch(const CNString& s, int pos = 0);'
  185. `int upsearch(const char *s, int pos=0) const;'
  186.      Returns the first occurence of character c or string s in this
  187.      string after position pos (zero based, default value pos = 0).
  188.      Returns len if c or s is not in this string after pos.
  189.  
  190. `bool matches(const char* cs, unsigned pos = 0);'
  191. `bool matches(const CNString& s, unsigned pos = 0);'
  192.      Returns TRUE if the character string cs or the string s is equal
  193.      to the part of this string starting at position pos (zero based,
  194.      default value pos = 0).
  195.  
  196. `operator const char * () const;'
  197.      Returns the the C string component of `CNString' to allow the use
  198.      of `CNString's in a `char *' context.
  199.  
  200. `char operator ()(int i) const;'
  201. `char &operator [](int i);'
  202.      Returns the i-th character (zero based) of this string.
  203.  
  204. `void operator = (const CNString& s);'
  205. `void operator = (const char* cs);'
  206. `void operator = (char c);'
  207.      Replaces this string with a copy of string s, character string cs
  208.      or character c.
  209.  
  210. `friend CNString operator + (const CNString& a, const CNString& b);'
  211.      Returns a string that is the concatenation of the strings `a' and
  212.      `b'.
  213.  
  214. `CNString& operator +=(const CNString &s);'
  215. `CNString& operator +=(const char* cs);'
  216.      Appends the C string `s' or the `CNString' `cs' to the end of this
  217.      string.
  218.  
  219. `friend bool operator <  (const CNString& a, const CNString& b);'
  220. `friend bool operator >  (const CNString& a, const CNString& b);'
  221. `friend bool operator >= (const CNString& a, const CNString& b);'
  222. `friend bool operator <= (const CNString& a, const CNString& b);'
  223. `friend bool operator == (const CNString& a, const CNString& b);'
  224. `friend bool operator != (const CNString& a, const CNString& b);'
  225.      Returns `TRUE' if the relation holds between the strings.
  226.  
  227. `void icopy(istream& strm = cin);'
  228. `istream &operator >> (istream& strm, CNString& s);'
  229.      Reads all characters up to (not including) the next newline from
  230.      input stream strm into the string.
  231.  
  232.    For programming convenience, a type for a `const' reference to a
  233. string is provided:
  234.  
  235. `typedef const CNString & CNStringR;'
  236. 
  237. File: cncl.info,  Node: CNNamed,  Next: CNIniFile,  Prev: CNString,  Up: Misc
  238.  
  239. CNNamed -- CNObject with Name
  240. =============================
  241.  
  242. SYNOPSIS
  243. --------
  244.  
  245.    `#include <CNCL/Named.h>'
  246.  
  247. TYPE
  248. ----
  249.  
  250.    `CN_NAMED'
  251.  
  252. * Menu:
  253.  
  254. BASE CLASSES
  255. ------------
  256. * CNObject::         Root of the CNCL Hierarchy
  257.  
  258. DERIVED CLASSES
  259. ---------------
  260.  
  261. RELATED CLASSES
  262. ---------------
  263.  
  264. * CNString::         Character String
  265.  
  266. DESCRIPTION
  267. -----------
  268.  
  269.    `CNNamed' is a data type for managing CNObject's names in CNString
  270. format.
  271.  
  272.    Constructors:
  273.  
  274. `CNNamed();'
  275. `CNNamed(CNStringR name);'
  276.      Initializes the string name object and optionally sets the name.
  277.  
  278.    In addition to the member functions required by CNCL, `CNNamed'
  279. provides:
  280.  
  281. `CNStringR name() const;'
  282. `CNStringR get_name() const;'
  283.      Returns the object's name.
  284.  
  285. `void name(CNStringR name) const;'
  286. `void set_name(CNStringR name) const;'
  287.      Sets the object's name.
  288.  
  289. 
  290. File: cncl.info,  Node: CNIniFile,  Next: CNFormInt,  Prev: CNNamed,  Up: Misc
  291.  
  292. CNIniFile -- .ini-style config file
  293. ===================================
  294.  
  295. SYNOPSIS
  296. --------
  297.  
  298.    `#include <CNCL/IniFile.h>'
  299.  
  300. TYPE
  301. ----
  302.  
  303.    `CN_INIFILE'
  304.  
  305. * Menu:
  306.  
  307. BASE CLASSES
  308. ------------
  309. * CNNamed::       CNObject with Name
  310.  
  311. DERIVED CLASSES
  312. ---------------
  313.  
  314. RELATED CLASSES
  315. ---------------
  316.  
  317. DESCRIPTION
  318. -----------
  319.  
  320.    The class `CNIniFile' reads/writes MSDOS-style .INI files.
  321. Example of a .INI file:
  322.  
  323.      # This is a comment
  324.      
  325.      [Test]
  326.      display = 1
  327.      string  = Hallo!
  328.      abc
  329.  
  330.    In this example the variables display, string and abc of section Test
  331. are declared. At this class each single line is handled as a node of a
  332. double linked list. Each node has a left entry (variable), a right one
  333. (value) and a type entry (COMM, EMPTY, SECTION, ENTRY, ENTRYNOEQ).
  334. Depending on the different types, left and/or right entry can be empty.
  335.  
  336. Attention : This class is still under construction ! !
  337.  
  338.    Constructors:
  339.  
  340. `CNIniFile();'
  341. `CNIniFile(CNParam *);'
  342. `CNIniFile(CNStringR name);'
  343.      Initializes the `CNIniFile'. The `name' parameter will
  344.      automatically read the file `name'.INI into double linked list.
  345.  
  346.    In addition to the member functions required by CNCL, `CNIniFile'
  347. provides:
  348.  
  349. `int read()'
  350. `int read(CNStringR name);'
  351.      Reads the specified .ini file. Either the object's name or the
  352.      `name' parameter is chosen.  The whole file is stored as a double
  353.      linked list.
  354.  
  355. `int write();'
  356. `int write(CNStringR name);'
  357.      Writes the current list into a .ini file.
  358.  
  359. `CNStringR get_entry(CNStringR section, CNStringR name, bool first=TRUE);'
  360.      NOT IMPLEMENTED YET.
  361.  
  362. `CNStringR get_entry(CNStringR name, bool first=TRUE);'
  363.      Returns the entry for `name' as a string.
  364.  
  365. `double get_double(CNStringR section, CNStringR name, bool first=TRUE);'
  366.      NOT IMPLEMENTED YET.
  367.  
  368. `double get_double(CNStringR name, bool first=TRUE);'
  369.      Returns the entry for `name' as a double.
  370.  
  371. `int get_int(CNStringR section, CNStringR name, bool first=TRUE);'
  372.      NOT IMPLEMENTED YET.
  373.  
  374. `int get_int(CNStringR name, bool first=TRUE);'
  375.      Returns the entry for `name' as an integer.
  376.  
  377. `bool test_entry(CNStringR section, CNStringR name);'
  378.      NOT IMPLEMENTED YET.
  379.  
  380. `bool test_entry(CNStringR name, bool first=TRUE);'
  381.      NOT IMPLEMENTED YET.
  382.  
  383. `CNStringR get_section();'
  384.      Returns the sections's name.
  385.  
  386. `void set_section(CNStringR section);'
  387.      Sets the internal `CNDLIterator' `ini_sec' to the begining of the
  388.      section called `name'
  389.  
  390. 
  391. File: cncl.info,  Node: CNFormInt,  Next: CNFormFloat,  Prev: CNIniFile,  Up: Misc
  392.  
  393. CNFormInt -- Integers as CNStrings
  394. ==================================
  395.  
  396. SYNOPSIS
  397. --------
  398.  
  399.    `#include <CNCL/FormInt.h>'
  400.  
  401. TYPE
  402. ----
  403.  
  404.    `CN_FORMINT'
  405.  
  406. * Menu:
  407.  
  408. BASE CLASSES
  409. ------------
  410. * CNString::    Character string
  411.  
  412. DERIVED CLASSES
  413. ---------------
  414.  
  415.  
  416. RELATED CLASSES
  417. ---------------
  418. * CNFormFloat::    Doubles as CNStrings
  419.  
  420. DESCRIPTION
  421. -----------
  422.  
  423.    This class converts Integers to Strings using different kinds of
  424. format styles provided by the stream-2.0-implementation. The current
  425. formats implemented in this class are 'left' and 'right'.  Note: If the
  426. Integer needs more characters than the width `w' indicates, the most
  427. right ones are ignored.
  428.  
  429.    Constructors:
  430.  
  431. `CNFormInt();'
  432. `CNFormInt(CNParam *param);'
  433. `CNFormInt(int a, int w);'
  434. `CNFormInt(int a, int w, char fill);'
  435. `CNFormInt(int a, int w, char fill, int f);'
  436.      Initializes `CNFormInt', setting the value to the integer value a
  437.      (default = 0), the string's width, the fill character fill
  438.      (default = ' ') and the format f (default = CNFormInt::right)
  439.  
  440.    The different formats implemented in `CNFormInt' are:
  441.  
  442. `int right = 1'
  443. `int left = 2'
  444.    In addition to the member functions required by CNCL, `CNFormInt'
  445. provides:
  446.  
  447. `int get_value();'
  448. `int value();'
  449.      Returns the value as an integer.
  450.  
  451. `void set_value(int a);'
  452. `void value(int a);'
  453.      Changes the old String and the old value to a.
  454.  
  455. `char get_fill();'
  456. `char fill();'
  457.      Returns the current fill character.
  458.  
  459. `void set_fill(char f);'
  460. `void fill(char f);'
  461.      Changes the String to the fill character f.
  462.  
  463. `int get_format();'
  464. `int format();'
  465.      Returns the current format as an integer. '1' descibes 'right', '2'
  466.      describes left.
  467.  
  468. `void set_format(int f);'
  469. `void format(int f);'
  470.      Changes the String to the new CNFormInt::formats f.
  471.  
  472. `int get_width();'
  473. `int width();'
  474.      Returns the String's width as an integer.
  475.  
  476. `void set_width(int w);'
  477. `void width(int w);'
  478.      Changes the old String's width to w.
  479.  
  480. 
  481. File: cncl.info,  Node: CNFormFloat,  Next: CNInt,  Prev: CNFormInt,  Up: Misc
  482.  
  483. CNFormFloat -- Doubles as CNStrings
  484. ===================================
  485.  
  486. SYNOPSIS
  487. --------
  488.  
  489.    `#include <CNCL/FormFloat.h>'
  490.  
  491. TYPE
  492. ----
  493.  
  494.    `CN_FORMFLOAT'
  495.  
  496. * Menu:
  497.  
  498. BASE CLASSES
  499. ------------
  500. * CNString::    Character strings
  501.  
  502. DERIVED CLASSES
  503. ---------------
  504.  
  505. RELATED CLASSES
  506. ---------------
  507. * CNFormInt::    Integer as CNStrings
  508.  
  509. DESCRIPTION
  510. -----------
  511.  
  512.    This class converts doubles to CNStrings using different kinds of
  513. format styles provided by the stream-2.0-implementation. The current
  514. formats implemented in this class are 'left' and 'right' in connection
  515. with 'scientific', 'showpoint' or 'fixed'.  Note: If the number is too
  516. long, the right part of it will be cut, no matter wich format style is
  517. chosen.  If the number is cut (because of the chosen precision) it will
  518. be round.  If the precision is not in the interval [0,16] problems with
  519. the accuracy might occur.
  520.  
  521.    Constructors:
  522.  
  523. `CNFormFloat();'
  524. `CNFormFloat(CNParam *param);'
  525. `CNFormFloat(double x, int w);'
  526. `CNFormFloat(double x, int w, char fill);'
  527. `CNFormFloat(double x, int w, char fill, int format);'
  528. `CNFormFloat(double x, int w, char fill, int format, int pr);'
  529.      Initializes the `FormFloat' with the value x (default = 0.0), the
  530.      width w (= 3), the fill character fill (= ' '), the format (=
  531.      right) and the precision pr (= 6).
  532.  
  533.    The different formats implemented in `CNFormFloat' are:
  534.  
  535. `int right = 1'
  536. `int left = 2'
  537. `int scientific = 4'
  538. `int showpoint = 8'
  539. `int fixed = 16'
  540.      These formats can be devided into two groups: right and left on one
  541.      hand and scientific, showpoint and fixed on the other. Those two
  542.      groups can be combiened with each other, e.g. left and scientific
  543.      (= 6) is as far possible as right and fixed (= 17).
  544.  
  545.    In addition to the member functions required by CNCL, `CNFormFloat'
  546. provides:
  547.  
  548. `double get_value();'
  549. `double value();'
  550. `char get_fill();'
  551. `char fill();'
  552. `formats get_format();'
  553. `formats format();'
  554. `int get_width();'
  555. `int width();'
  556. `int get_precision();'
  557. `int precision();'
  558.      Returns value, fill character, format style, width or precision of
  559.      the current CNFormFloat.
  560.  
  561. `void set_value(double x);'
  562. `void value(double x);'
  563. `void set_fill(char f);'
  564. `void fill(char f);'
  565. `void set_format(formats f);'
  566. `format(formats f);'
  567. `void set_width(int w);'
  568. `void width(int w);'
  569. `void set_precision(int pr);'
  570. `void precision(int pr);'
  571.      Changes the current CNFormFloat by its value, fill character,
  572.      format style, width or precision.
  573.  
  574. 
  575. File: cncl.info,  Node: CNInt,  Next: CNDouble,  Prev: CNFormFloat,  Up: Misc
  576.  
  577. CNInt -- Integers derived from CNObject
  578. =======================================
  579.  
  580. SYNOPSIS
  581. --------
  582.  
  583.    `#include <CNCL/Int.h>'
  584.  
  585. TYPE
  586. ----
  587.  
  588.    `CN_INT'
  589.  
  590. * Menu:
  591.  
  592. BASE CLASSES
  593. ------------
  594. * CNObject::    Base class
  595.  
  596. DERIVED CLASSES
  597. ---------------
  598.  
  599. RELATED CLASSES
  600. ---------------
  601. * CNDouble::    Doubles derived from CNObject
  602.  
  603. DESCRIPTION
  604. -----------
  605.  
  606.    This class provides a long int value derived from CNObject. Such it
  607. combines the behavior of the builtin type long int with the possibility
  608. to use this type with generic containers (like CNDLList) or as
  609. parameters to CNEvents and SDLSignals.
  610. Note: CNInt consumes much more memory than an ordinary long int.
  611. Therefore it isn't a good idea to create large arrays of CNInts when
  612. one doesn't need its special capabilities.
  613. Constructors:
  614.  
  615. `CNInt(long n=0);'
  616. `CNInt(CNParam *param);'
  617.      Initializes the `Int' with the value n (default = 0).
  618. In addition to the member functions required by CNCL, `CNInt' provides:
  619.  
  620. `operator long()'
  621.      Conversion of CNInt to ordinary long. This allows the use of
  622.      `CNInt' in calculations.
  623.      Note: to explicitly convert a CNInt identifier to a double (or
  624.      else) write double(long(identifier)). Implicit conversion however
  625.      works well without casting to long first.
  626.  
  627. `long operator ++()'
  628. `long operator ++(int)'
  629.      Prefix and postfix version of increment.
  630.  
  631. `long operator --()'
  632. `long operator --(int)'
  633.      Prefix and postfix version of decrement.
  634.  
  635. `long operator -()'
  636. `long operator +()'
  637.      Unary minus and plus operator.
  638.  
  639. `long operator +=(long n)'
  640. `long operator -=(long n)'
  641. `long operator *=(long n)'
  642. `long operator /=(long n)'
  643. `long operator %=(long n)'
  644.      Arithmetic operators where a `CNInt' is on the left and on the
  645.      right side of an equation.
  646.  
  647. `long operator ^=(long n)'
  648. `long operator |=(long n)'
  649. `long operator &=(long n)'
  650. `long operator !=(long n)'
  651.      Logical operators where a `CNInt' is on the left and on the right
  652.      side of an equation.
  653.  
  654. `long operator <<=(long n)'
  655. `long operator >>=(long n)'
  656.      Left and right shifts of a `CNInt'.
  657.  
  658.      Note: unary * and & operators aren't overloaded.
  659.  
  660. 
  661. File: cncl.info,  Node: CNDouble,  Next: CNGetOpt,  Prev: CNInt,  Up: Misc
  662.  
  663. CNDouble -- Doubles derived from CNObject
  664. =========================================
  665.  
  666. SYNOPSIS
  667. --------
  668.  
  669.    `#include <CNCL/Double.h>'
  670.  
  671. TYPE
  672. ----
  673.  
  674.    `CN_DOUBLE'
  675.  
  676. * Menu:
  677.  
  678. BASE CLASSES
  679. ------------
  680. * CNObject::    Base class
  681.  
  682. DERIVED CLASSES
  683. ---------------
  684.  
  685. RELATED CLASSES
  686. ---------------
  687. * CNInt::    Integers derived from CNObject
  688.  
  689. DESCRIPTION
  690. -----------
  691.  
  692.    This class provides a double value derived from CNObject. Such it
  693. combines the behavior of the builtin type double with the possibility
  694. to use this type with generic containers (like CNDLList) or as
  695. parameters to CNEvents and SDLSignals.
  696. Note: CNDouble consumes much more memory than an ordinary double.
  697. Therfore it isn't a good idea to create large arrays of CNDoubles when
  698. one doesn't need its special capabilities.
  699. Constructors:
  700.  
  701. `CNDouble(double n=0.0);'
  702. `CNDouble(CNParam *param);'
  703.      Initializes the `Double' with the value n (default = 0.0).
  704.  
  705. In addition to the member functions required by CNCL, `CNDouble'
  706. provides:
  707.  
  708. `operator double()'
  709.      Conversion of CNDouble to ordinary double. This allows the use of
  710.      `CNDouble' in  calculations.
  711.      Note: to explicitly convert a CNDouble identifier to an ordinary
  712.      long (or else) write long(double(identifier)). Implicit conversion
  713.      however works well without casting to double first.
  714.  
  715. `double operator -()'
  716. `double operator +()'
  717.      Unary minus and plus operator.
  718.  
  719. `double operator +=(double n)'
  720. `double operator -=(double n)'
  721. `double operator *=(double n)'
  722. `double operator /=(double n)'
  723.      Arithmetic operators where a `CNDouble' is on the left and on the
  724.      right side of an equation.
  725.  
  726.      Note: unary * and & operators aren't overloaded.
  727.  
  728. 
  729. File: cncl.info,  Node: CNGetOpt,  Next: CNRef,  Prev: CNDouble,  Up: Misc
  730.  
  731. CNGetOpt -- Interface to GNU getopt()
  732. =====================================
  733.  
  734. SYNOPSIS
  735. --------
  736.  
  737.    `#include <CNCL/GetOpt.h>'
  738.  
  739. TYPE
  740. ----
  741.  
  742.    `CN_GETOPT'
  743.  
  744. * Menu:
  745.  
  746. BASE CLASSES
  747. ------------
  748. * CNObject::    Base class
  749.  
  750. DERIVED CLASSES
  751. ---------------
  752.  
  753. RELATED CLASSES
  754. ---------------
  755.  
  756. DESCRIPTION
  757. -----------
  758.  
  759.    This class manages the interface to the GNU getopt() functionality.
  760. As an example for its use please see the file `tGetOpt.c' at the
  761. directory `CNCL/lib/misc/test'.
  762.  
  763. Constructors:
  764.  
  765. `CNGetOpt();'
  766. `CNGetOpt(CNParam *);'
  767. `CNGetOpt(int argc, char **argv, char *copts=NIL);'
  768. In addition to the member functions required by CNCL, `CNGetOpt'
  769. provides:
  770.  
  771. `enum ParamType { NOPARAM=0, WPARAM=1, OPTPARAM=2 };'
  772. `struct option { char *name; int has_arg; int *flag; int val; };'
  773.      Describe the long-named options requested by the application. The
  774.      LONG_OPTIONS argument to getopt_long or getopt_long_only is a
  775.      vector of `struct option' terminated by an element containing a
  776.      name which is zero.
  777.  
  778.      `has_arg' is NOPARAM (0) if the option does not take an argument,
  779.      WPARAM (1) if the option requires an argument, or OPTPARAM (2) if
  780.      the option takes an optional argument.
  781.  
  782.      If `flag' is not NULL, it points to a variable that is set to the
  783.      value given in `val' when the option is found, but left unchanged
  784.      if the option is not found.
  785.  
  786.      To have a long-named option do something other than set an `int'
  787.      to a compiled-in constant, such as set a value from `optarg', set
  788.      `flag' to zero and `val' to a nonzero value (the equivalent
  789.      single-letter option character, if there is one). For long options
  790.      that have a zero `flag', `GetOpt' returns the contents of `val'.
  791.  
  792. `void set_args(int argc, char **argv);'
  793.      Set the `argc' and `argv' options.
  794.  
  795. `void set_char_options(char *copts);'
  796.      Set the single character option.
  797.  
  798. `void set_long_options(option *lopts);'
  799.      Set the long options array.
  800.  
  801. `void add_long_option (char *lopt, ParamType pt, char copt);'
  802.      Adds one long option to the current array (up to a total size of 32
  803.      elements).  An example for one array entry could be:
  804.           { "help", 0, 0, 'h'},   /* Help */
  805.  
  806. `int getopt();'
  807. `int getopt(int argc, char *const *argv, const char *optstring);'
  808. `int operator() ();'
  809.      Return the (short) getopt() value.
  810.  
  811. `int getopt_long(int argc, char *const *argv, const char *options, const struct option *long_options,'
  812. `int *opt_index);'
  813.      Handles both short and long options.
  814.  
  815. `int getopt_long_only(int argc, char *const *argv, const char *options, const struct option *long_options,'
  816. `int *opt_index);'
  817.      Handles only long options.
  818.  
  819. `char  *optarg();'
  820. `double optarg_double();'
  821. `int optarg_int()'
  822. `int optind();'
  823. `int optopt();'
  824. `void opterr(int err);'
  825.      These functions return the internal argument, index, unrecognized
  826.      option character or error value. These values are taken from the
  827.      original getopt.[h,c] files.
  828.  
  829. 
  830. File: cncl.info,  Node: CNRef,  Next: CNRefObj,  Prev: CNGetOpt,  Up: Misc
  831.  
  832. CNRef -- Base class for classes with reference counting
  833. =======================================================
  834.  
  835. SYNOPSIS
  836. --------
  837.  
  838.    `#include <CNCL/Ref.h>'
  839.  
  840. TYPE
  841. ----
  842.  
  843. * Menu:
  844.  
  845. BASE CLASSES
  846. ------------
  847. None
  848.  
  849. DERIVED CLASSES
  850. ---------------
  851. * CNRefObj::    CNObject with reference counting
  852. * CNRefNamed::    CNNamed with reference counting
  853.  
  854. RELATED CLASSES
  855. ---------------
  856. * CNPtr::    Intelligent pointer to CNRefObjs
  857.  
  858. DESCRIPTION
  859. -----------
  860.  
  861.    This class is the base class for classes with reference counting.
  862. Note: `CNRef' is outside of CNCL's inheritance tree and is always used
  863. as a further base class of its children, which are also derived from
  864. `CNObject'.
  865.  
  866.    With the help of reference counting you can track all references to
  867. instances of `CNObject'.
  868.  
  869.    See *note CNPtr::. and the file `tRef.c' in directory
  870. `CNCL/lib/misc/test' for examples.
  871.  
  872. Constructors:
  873.  
  874. `CNRef();'
  875.      Initially the reference counter is set to zero.
  876.  
  877. `CNRef' provides:
  878.  
  879. `void ref();'
  880.      Increase the reference counter by one.
  881.  
  882. `void deref();'
  883.      Decrease the reference counter by one. If the reference counter
  884.      already was equal to zero, CNCL aborts with an error message. If
  885.      the decreased reference counter equals to zero, then the object of
  886.      this class deletes itself from memory, i.e. `delete this;'! In
  887.      this case you cannot access this object any longer.
  888.  
  889. `unsigned long get_count() const;'
  890.      Returns the number of references.
  891.  
  892. `static void set_debug(bool r, bool = FALSE);'
  893.      If `r' is set to `TRUE', all calls to `ref()' and `deref()' are
  894.      logged and a respective message is output to `cerr'. The second
  895.      parameter has no funcionality, yet.
  896.  
  897. 
  898. File: cncl.info,  Node: CNRefObj,  Next: CNRefNamed,  Prev: CNRef,  Up: Misc
  899.  
  900. CNRefObj -- CNObject with reference counting
  901. ============================================
  902.  
  903. SYNOPSIS
  904. --------
  905.  
  906.    `#include <CNCL/RefObj.h>'
  907.  
  908. TYPE
  909. ----
  910.  
  911.    `CN_REFOBJ'
  912.  
  913. * Menu:
  914.  
  915. BASE CLASSES
  916. ------------
  917. * CNObject::    First base class
  918. * CNRef::    Second base class
  919.  
  920. DERIVED CLASSES
  921. ---------------
  922. None
  923.  
  924. RELATED CLASSES
  925. ---------------
  926. * CNRefNamed::    CNNamed with reference counting
  927. * CNPtr::    Intelligent pointer to CNRefObjs
  928.  
  929. DESCRIPTION
  930. -----------
  931.  
  932.    This class provides a common base for `CNObject's, all references to
  933. which should be kept track of by its second base class `CNRef'.
  934.  
  935. Constructors:
  936.  
  937. `CNRefObj();'
  938. In addition to the member functions required by CNCL, `CNRefObj'
  939. provides no further functions.
  940.  
  941. 
  942. File: cncl.info,  Node: CNRefNamed,  Next: CNPtr,  Prev: CNRefObj,  Up: Misc
  943.  
  944. CNRefNamed -- CNNamed with reference counting
  945. =============================================
  946.  
  947. SYNOPSIS
  948. --------
  949.  
  950.    `#include <CNCL/RefNamed.h>'
  951.  
  952. TYPE
  953. ----
  954.  
  955.    `CN_REFNAMED'
  956.  
  957. * Menu:
  958.  
  959. BASE CLASSES
  960. ------------
  961. * CNNamed::    First base class
  962. * CNRef::    Second base class
  963.  
  964. DERIVED CLASSES
  965. ---------------
  966. None
  967.  
  968. RELATED CLASSES
  969. ---------------
  970. * CNRefObj::    CNObject with reference counting
  971. * CNPtr::    Intelligent pointer to CNRefObjs
  972.  
  973. DESCRIPTION
  974. -----------
  975.  
  976.    This class provides a common base for `CNNamed's, all references to
  977. which should be kept track of by its second base class `CNRef'.
  978.  
  979. Constructors:
  980.  
  981. `CNRefNamed();'
  982. `CNRefNamed(CNStringR name);'
  983. In addition to the member functions required by CNCL, `CNRefNamed'
  984. provides no further functions.
  985.  
  986. 
  987. File: cncl.info,  Node: CNPtr,  Next: EZD,  Prev: CNRefNamed,  Up: Misc
  988.  
  989. CNPtr -- Intelligent pointer to CNRefObjs
  990. =========================================
  991.  
  992. SYNOPSIS
  993. --------
  994.  
  995.    `#include <CNCL/Ptr.h>'
  996.  
  997. TYPE
  998. ----
  999.  
  1000.    `CN_PTR'
  1001.  
  1002. * Menu:
  1003.  
  1004. BASE CLASSES
  1005. ------------
  1006. * CNObject::    Base class
  1007.  
  1008. DERIVED CLASSES
  1009. ---------------
  1010. None
  1011.  
  1012. RELATED CLASSES
  1013. ---------------
  1014. * CNRef::       Base class for classes with reference counting
  1015. * CNRefObj::    CNObject with reference counting
  1016. * CNRefNamed::    CNNamed with reference counting
  1017.  
  1018. DESCRIPTION
  1019. -----------
  1020.  
  1021.    This class provides an intelligent pointer to `CNRefObj's, i.e. if
  1022. you copy one `CNPtr' to another one, then the reference count of the
  1023. `CNRefObj' contained in the source `CNPtr' is increased automatically
  1024. and the reference count of the `CNRefObj' contained in the destination
  1025. `CNPtr' is decreased automatically. See example below.
  1026.  
  1027. Constructors:
  1028.  
  1029. `CNPtr();'
  1030. `CNPtr(CNParam *param);'
  1031. `CNPtr(CNRefObj *o);'
  1032. `CNPtr(const CNPtr &p);'
  1033. In addition to the member functions required by CNCL, `CNPtr' provides:
  1034.  
  1035. `CNPtr& operator =(const CNPtr& p)'
  1036.      Intelligent assignment operator.  Additionally to copying the
  1037.      `CNRefObj' data member, the reference count of the `CNRefObj' data
  1038.      member contained in the source `CNPtr' is increased automatically
  1039.      and the reference count of the `CNRefObj' data member contained in
  1040.      the destination `CNPtr' is decreased automatically.
  1041.  
  1042. `CNRefObj *operator ->() const'
  1043. `CNRefObj *get_object() const'
  1044.      Returns the `CNRefObj' data member.
  1045.  
  1046. Example:
  1047.      CNRefObj *source_obj, *dest_obj;
  1048.      CNPtr    *source, *dest;
  1049.      
  1050.      source_obj = new CNRefObj;
  1051.      source_obj->ref();
  1052.      source = new CNPtr(source_obj);
  1053.      
  1054.      dest_obj = new CNRefObj;
  1055.      dest_obj->ref();
  1056.      dest = new CNPtr(dest_obj);
  1057.      
  1058.      // ref counts
  1059.      // source_obj : 1
  1060.      // dest_obj   : 1
  1061.      
  1062.      // copy contents of source to dest
  1063.      // implicitly increase counter of source_obj
  1064.      // implicitly decrease counter of dest_obj and delete it
  1065.      
  1066.      *dest = *source;
  1067.      // ref counts
  1068.      // source_obj : 2
  1069.      // dest_obj   : 0 (deleted)
  1070.      
  1071.      // implicitly decrease counter of source_obj
  1072.      delete source;
  1073.      // implicitly decrease counter of source_obj and delete it
  1074.      delete dest;
  1075.  
  1076. 
  1077. File: cncl.info,  Node: Unix,  Next: Misc,  Prev: Object Management,  Up: Top
  1078.  
  1079. Unix Classes
  1080. ************
  1081.  
  1082.    The classes described here provide an interface to the UNIX operating
  1083. system. Thus they will only work on machines where UNIX or compareable
  1084. systems like LINUX are installed. E.g., You won't be able to use them
  1085. in a DOS environment.
  1086.  
  1087. Additional information about the different Unix systam calls see the
  1088. man pages and your manual.
  1089.  
  1090. * Menu:
  1091.  
  1092. Unix
  1093. ----
  1094. * CNPipe::              Unix Pipe
  1095. * CNSelect::        Class Interface to Select(2) System Call
  1096.  
  1097. 
  1098. File: cncl.info,  Node: CNPipe,  Next: CNSelect,  Prev: CNManager,  Up: Unix
  1099.  
  1100. CNPipe -- Unix Pipe
  1101. ===================
  1102.  
  1103. SYNOPSIS
  1104. --------
  1105.  
  1106.    `#include <CNCL/Pipe.h>'
  1107.  
  1108. TYPE
  1109. ----
  1110.  
  1111.    `CN_PIPE'
  1112.  
  1113. * Menu:
  1114.  
  1115. BASE CLASSES
  1116. ------------
  1117. * CNObject::        Root of the CNCL Hierarchy
  1118.  
  1119. DERIVED CLASSES
  1120. ---------------
  1121.  
  1122. RELATED CLASSES
  1123. ---------------
  1124.  
  1125. DESCRIPTION
  1126. -----------
  1127.  
  1128.    `CNPipe' creates and manages Unix I/O pipes between two programs,
  1129. thus that two cooperating processes can transfer data.
  1130.  
  1131.    Constructors:
  1132.  
  1133. `CNPipe();'
  1134. `CNPipe(CNParam *param);'
  1135. `CNPipe(const CNString& prog);'
  1136.      Initializing the pipe. If the program name `prog' is set, the pipe
  1137.      will be opened immediately. Otherwise the open() command has to be
  1138.      used when  needed. The destructor closes the pipe if it was not
  1139.      closed before.
  1140. In addition to the member functions required by CNCL, `CNPipe' provides:
  1141.  
  1142. `int open(const CNString& prog);'
  1143.      Opens the pipe to the program. If the pipe already exists, the old
  1144.      pipe will be closed before opening the new one.  The returned
  1145.      integer value indicates the success of the opening process.  If
  1146.      successful 0 is returned, otherwise an error message is shown and
  1147.      -1 is returned.
  1148.  
  1149. `int close();'
  1150.      Closes an existing pipe. If an error occurs, -1 is returned,
  1151.      otherwise a 0.
  1152.  
  1153. `ostream & out();'
  1154. `istream & in ();'
  1155.      Returns the input/output stream.
  1156.  
  1157. `int fd_in();'
  1158. `int fd_out();'
  1159.      Returns the I/O pipe file descriptors.
  1160.  
  1161. `int get_pid();'
  1162.      Returns the program's PID.
  1163.  
  1164. 
  1165. File: cncl.info,  Node: CNSelect,  Next: CNCoord,  Prev: CNPipe,  Up: Unix
  1166.  
  1167. CNSelect -- Class Interface to Select(2) System Call
  1168. ====================================================
  1169.  
  1170. SYNOPSIS
  1171. --------
  1172.  
  1173.    `#include <CNCL/Select.h>'
  1174.  
  1175. TYPE
  1176. ----
  1177.  
  1178.    `CN_SELECT'
  1179.  
  1180. * Menu:
  1181.  
  1182. BASE CLASSES
  1183. ------------
  1184. * CNObject::        Root of the CNCL Hierarchy
  1185.  
  1186. DERIVED CLASSES
  1187. ---------------
  1188.  
  1189. RELATED CLASSES
  1190. ---------------
  1191.  
  1192. DESCRIPTION
  1193. -----------
  1194.  
  1195.    `CNSelect' is the interface to Unix's "select(2)" system call for
  1196. synchronous I/O multiplexing. Select(2) (refer to Unix man pages, too)
  1197. examines the descriptor sets and detects if they are ready for reading,
  1198. writing, or having an exceptional status.
  1199.  
  1200.    Constructors:
  1201.  
  1202. `CNSelect();'
  1203. `CNSelect(CNParam *param);'
  1204. `CNSelect(int fd);'
  1205.      Initializes the three descriptor sets (one for the reading,
  1206.      writing and exceptional descriptor set) to null sets. Optionally
  1207.      the particular descriptor `fd' in the read set.
  1208. In addition to the member functions required by CNCL, `CNSelect'
  1209. provides:
  1210.  
  1211. `void add_read(int fd);'
  1212. `void del_read(int fd);'
  1213. `bool test_read(int fd);'
  1214.      Adds/deletes/tests file descriptor `fd' to the read set.
  1215.  
  1216. `void add_write(int fd);'
  1217. `void del_write(int fd);'
  1218. `bool test_write(int fd);'
  1219.      Adds/deletes/tests file descriptor `fd' to the write set.
  1220.  
  1221. `void add_except(int fd);'
  1222. `void del_except(int fd);'
  1223. `bool test_except(int fd);'
  1224.      Adds/deletes/tests file descriptor `fd' to the except set.
  1225.  
  1226. `bool select();'
  1227. `bool select(long sec, long usec);'
  1228.      Returns true if there are any ready descriptors in the three
  1229.      descriptor sets. If the time values `sec' and `usec' for the
  1230.      `timeout' are set, false is returned if the timer expires.
  1231.  
  1232. 
  1233. File: cncl.info,  Node: EZD Interface,  Next: Fuzzy,  Prev: Misc,  Up: Top
  1234.  
  1235. EZD Interface Classes
  1236. *********************
  1237.  
  1238. The following classes provide an interface to DEC's Easy Draw
  1239. application.  Easy Draw is an application written in scheme which alows
  1240. easy drawing on the X 11 Window system. The CNCL simulation programs
  1241. communicate via UNIX pipes with Easy Draw.
  1242. These classes use Xcolors and Xfonts. A list of the colors you can find
  1243. at `/usr/global/lib/X11' in the file rgb.txt, for a list of fonts use
  1244. the command `xlsfonts'. Only the color 'clear' is added to allow
  1245. transparent objects in the drawing.
  1246. Additionally to the colors some stipple patterns are defined at EZD.
  1247. They are called s0, s1, ... , s16, where the number is representing the
  1248. amount of drawn pixels (in the defined color) in a square of 4-by-4.
  1249. However, this option is ignored when postscript files are written.
  1250.  
  1251. You can find additional information about ezd at the man pages.
  1252.  
  1253. * Menu:
  1254.  
  1255. EZD
  1256. ---
  1257. * EZD::                 Base Class for EZD Graphic Objects
  1258. * EZDObject::           Interface to EZD Object
  1259. * EZDDrawing::          Interface to EZD Drawings
  1260. * EZDPushButton::       Interface to EZD Push-Button
  1261. * EZDWindow::           Interface to EZD Windows
  1262. * EZDDiagWin::          Extra window with x-y diagram
  1263. * EZDTextWin::          EZD window for easy text display
  1264. * EZDDiag::             x-y diagram as an EZDObject
  1265. * EZDBlock::            Block with small rectangles for bit display
  1266. * EZDPopUp::            Interface to EZD popup menu
  1267. * EZDQueue::            Graphical Representation of a Queue
  1268. * EZDServer::           Graphical Representation of a Server
  1269. * EZDText::             EZD Object with Text
  1270. * EZDTimer::            Graphical Representation of a Timer
  1271.  
  1272. 
  1273. File: cncl.info,  Node: EZD,  Next: EZDObject,  Prev: CNPtr,  Up: EZD Interface
  1274.  
  1275. EZD -- Base Class for EZD Graphic Objects
  1276. =========================================
  1277.  
  1278. SYNOPSIS
  1279. --------
  1280.  
  1281.    `#include <CNCL/EZD.h>'
  1282.  
  1283. TYPE
  1284. ----
  1285.  
  1286.    `CN_EZD'
  1287.  
  1288. * Menu:
  1289.  
  1290. BASE CLASSES
  1291. ------------
  1292. * CNNamed::            CNObject with Name
  1293.  
  1294. DERIVED CLASSES
  1295. ---------------
  1296. * EZDDrawing::          Interface to EZD Drawing
  1297. * EZDObject::           Interface to EZD Objects
  1298. * EZDPushButton::       Interface to EZD Push-Button
  1299. ....
  1300.  
  1301. RELATED CLASSES
  1302. ---------------
  1303.  
  1304. DESCRIPTION
  1305. -----------
  1306.  
  1307. `EZD' is the base class for EZD graphic objects. It manages the access
  1308. to EZD's I/O streams and provides the EZD drawing primitives.  For
  1309. additional information about EZD, refer to the manual pages of EZD.
  1310. Constructors:
  1311.  
  1312. `EZD();'
  1313. `EZD(CNParam *param);'
  1314. `EZD(const CNStringR name);'
  1315.      Initializes and opens the pipe to the EZD process.
  1316. In addition to the  member functions required by CNCL, `EZD' provides:
  1317.  
  1318. `static ostream & out();'
  1319.      Connects the stream from the program to the EZD process.
  1320.  
  1321. `static istream & in();'
  1322.      Connects the stream from the EZD process to the program.
  1323.  
  1324. `static void draw_point(int x, int y, const CNStringR col)'
  1325.      Draws a point at position (x,y) in color `col'.
  1326.  
  1327. `static void draw_line(int x1, int y1, int x2, int y2, const CNStringR col, int width = -1);'
  1328. `static void draw_dash_line(int x1, int y1, int x2, int y2, const CNStringR col, int width = -1);'
  1329.      Draws a (dashed) line from point `(x1,y1)' to point `(x2,y2)' in
  1330.      color `col' and `width' pixels wide. If `width' is <= 0, the
  1331.      minimum of one pixel is used for it.
  1332.  
  1333. `static void draw_arc(int x, int y, int w, int h, int a1, int a2, const CNStringR col, int width = -1);'
  1334.      Draws an unfilled arc. `(x,y)' are the minimum coordinates of the
  1335.      rectangle defining the arc. The arc's rectangle size is width `w'
  1336.      by height `h'. The arc starts at `a1' degrees and spans `a2'
  1337.      degrees - all angles are measured in the positive mathematical
  1338.      sense, the positive x-axis is the reference axis. The drawing
  1339.      color is `col' and the line width is `width'. If width <= 0 EZD's
  1340.      default value (1 pixel) is used.
  1341.  
  1342. `static void draw_fill_arc(int x, int y, int w, int h, int a1, int a2, const CNStringR col);'
  1343.      Draws a filled arc (end-point to end-point of the arc). `(x,y)' are
  1344.      the minimum coordinates of the rectangle  defining the  arc. The
  1345.      arcs rectangle size is width w by heigth h. The arc starts at a1
  1346.      degrees and spans a2 degrees - all angles measured in positive
  1347.      mathematical sense, the positive x-axis is the reference axis. The
  1348.      drawing color is `col'.
  1349.  
  1350. `static void draw_pie_arc(int x, int y, int w, int h, int a1, int a2, const CNStringR col);'
  1351.      Draws an arc (the arc is closed by drawing a line from each arc end
  1352.      point to the center of the rectangle defining the arc).  `(x,y)'
  1353.      are the minimum coordinates of the rectangle  defining the arc.
  1354.      The arcs rectangle size is width w by heigth h. The arc starts at
  1355.      a1 degrees and spans a2 degrees - all angles measured in positive
  1356.      mathematical sense,  the positive x-axis is the reference axis. The
  1357.      drawing color is `col'.
  1358.  
  1359. `static void draw_rectangle(int x, int y, int w, int h, const CNStringR col, int width = -1);'
  1360.      Draws an unfilled rectangle. `(x,y)' are the minimum coordinates.
  1361.      The size is defined by its width w and its heigth h. The drawing
  1362.      color is `col' and the line width is `width'. If width is <= 0
  1363.      EZD's default value (1 pixel) is used.
  1364.  
  1365. `static void draw_fill_rectangle(int x, int y, int w, int h, const'
  1366.      CNStringR col);
  1367.  
  1368. `static void draw_fill_rectangle(int x, int y, int w, int h, const CNStringR col, CNStringR stipple);'
  1369.      Draws a filled rectangle. `(x,y)' are the minimum coordinates. The
  1370.      size is defined by its width w and its heigth h. The drawing color
  1371.      is `col'.
  1372.  
  1373. `static void draw_text(int x, int y, const CNStringR text, const CNStringR col, const CNStringR font);'
  1374. `static void draw_text(int x, int y, int w, int h, const CNStringR align, const CNStringR text, const CNStringR col, const CNStringR font);'
  1375.      Writes `text' in the current drawing. `(x,y)' are the minimum
  1376.      coordinates of the rectangle containing the text. `col' and `font'
  1377.      describe color and font of the text. The optional width w, heigth
  1378.      h and alignment information describe the size of this rectangle
  1379.      and how the text has to be positioned in it. If the text does not
  1380.      fit in, no text is displayed at all.
  1381.      NOTE: Alternate functions with const char * args instead of
  1382.      CNStringR are supplied for g++ 2.5.8, because g++ 2.5.8 generates
  1383.      buggy code at least for calls to the 2nd draw_text() with string
  1384.      constants "abc" args. Some of the temporary CNStrings are freed
  1385.      twice.
  1386.  
  1387. `static void draw_bitmap(int x, int y, CNStringR filename, CNStringR color1 = "black", CNStringR color2= "");'
  1388. `static void draw_bitmap(int x, int y, int w, int h, CNStringR filename, CNStringR color1 = "black", CNStringR color2= "");'
  1389.      Draws the bitmap for the file `filename' at position `x,y' in
  1390.      width `w' and height `h'. The bits that are on are drawn in
  1391.      `color1', those which are off in `color2'.
  1392.      NOTE: The file must contain an X11 bitmap, a monochrome portable
  1393.      bitmap (PBM, type P1), a gray scale portable bitmap (PGM, type
  1394.      P2), or a color portable bitmap (PPM, type P3).
  1395.      NOTE: Same problem with g++ 2.5.8 as described at the method
  1396.      `draw_text()'.
  1397.  
  1398. `static void draw_now();'
  1399.      Causes any buffered changes to be drawn immideately.
  1400.  
  1401. `static void draw_clear();'
  1402.      Clears the current drawing.
  1403.  
  1404. `static void pause(int msec);'
  1405.      Forces out any buffered changes and stops reading commands from
  1406.      stdin until either `msec' milliseconds pass or some event action
  1407.      issues a quit command.
  1408.  
  1409. `static CNString event();'
  1410.      Reads event from pipe in EZD.
  1411.  
  1412. `static bool test_event();'
  1413.      Returns true if there are ready descriptors in the I/O descriptor
  1414.      sets (see also: CNSelect or man pages to "select(2)" system call)
  1415.  
  1416. `static void set_scale(const float xscale_x, const float xscale_y, const int xorigin_x, const int xorigin_y);'
  1417. `static int x2pix(const float x);'
  1418. `static int y2pix(const float y);'
  1419.      In some applications it is necessary to map a drawing with a
  1420.      cartesian coordinate system onto a window which uses pixels.
  1421.      `set_scale' specifies the scale factor (default: scale (x,y) =
  1422.      (1.0,1.0), origin (x,y) = (0,0)). `x2pix' and `y2pix' evaluate the
  1423.      coordinate transformation for the given values `(x,y)' by the
  1424.      formula `(value * scale + origin)', rounded to an integer.
  1425.  
  1426. `static void print_window(CNStringR winname, CNStringR dateiname);'
  1427.      Prints the window named `winname' to disk. The file `dateiname' is
  1428.      in postscript format.
  1429.  
  1430. `static void save_drawing();'
  1431. `static void restore_drawing();'
  1432.      Saves/restores the current drawing.
  1433.  
  1434. 
  1435. File: cncl.info,  Node: EZDObject,  Next: EZDDrawing,  Prev: EZD,  Up: EZD Interface
  1436.  
  1437. EZDObject -- Interface to EZD Object
  1438. ====================================
  1439.  
  1440. SYNOPSIS
  1441. --------
  1442.  
  1443.    `#include <CNCL/EZDObject>'
  1444.  
  1445. TYPE
  1446. ----
  1447.  
  1448.    `CN_EZDOBJECT'
  1449.  
  1450. * Menu:
  1451.  
  1452. BASE CLASSES
  1453. ------------
  1454. * EZD::           Base Class for EZD Graphic Objects
  1455.  
  1456. DERIVED CLASSES
  1457. ---------------
  1458. * EZDQueue::      Graphical Representation of a Queue
  1459. * EZDServer::     Graphical Representation of a Server
  1460. * EZDText::       EZD Object with Text
  1461. * EZDTimer::      Graphical Representation of a Timer
  1462.  
  1463. RELATED CLASSES
  1464. ---------------
  1465. * EZDDrawing::    Interface to EZD Drawings
  1466. * EZDPushButton:: Interface to EZD Push-Button
  1467. * EZDWindow::     Interface to EZD Windows
  1468.  
  1469. DESCRIPTION
  1470. -----------
  1471.  
  1472. `EZDObject' provides an interface to the objects of Easy Draw.  Thus
  1473. the drawings in all derived classes are handled as objects.
  1474. Constructors:
  1475. `EZDObject();'
  1476. `EZDObject(CNParam *param);'
  1477. `EZDObject(int x, int y);'
  1478. `EZDObject(const CNStringR name, int x, int y);'
  1479.      Initializes the EZD-object with either name "obj" or `&name'.
  1480.      `(x,y)' are the object's minimum coordinates.
  1481. Public accessible members:
  1482.  
  1483. `int x();'
  1484.      Returns the `EZDObject''s x coordinate.
  1485.  
  1486. `int x(int vx);'
  1487.      Returns the `EZDObject''s old x coordinate and changes it to `vx'.
  1488.  
  1489. `int y();'
  1490.      Returns the `EZDObject''s y coordinate.
  1491.  
  1492. `int y(int vy);'
  1493.      Returns the `EZDObject''s old y coordinate and changes it to `vy'.
  1494. In addition to the member functions required by CNCL, `EZDObject'
  1495. provides:
  1496.  
  1497. `void start();'
  1498. `void start(const CNStringR object_name);'
  1499. `void end();'
  1500.      "Start/End object drawing" command. All drawing commands between
  1501.      `start()' and `end()' draw the named object in the current
  1502.      drawing. If the named object already exists in the current
  1503.      drawing, it is replaced by the new one. If no drawing commands are
  1504.      specified between `start()' and `end()', the drawing still exists,
  1505.      but with no graphical representation.
  1506.  
  1507. `void delete_obj(const CNStringR draw_name = "draw");'
  1508.      Deletes the named drawing in the current object.
  1509.  
  1510. `int get_lastxb(void);'
  1511. `int get_lastyb(void);'
  1512. `int get_lastxe(void);'
  1513. `int get_lastye(void);'
  1514.      Returns the object's last positions.
  1515.  
  1516. `void point(int x, int y, const CNStringR col);'
  1517. `void line(int x1, int y1, int x2, int y2, const CNStringR col, int width = -1);'
  1518. `void arc(int x, int y, int w, int h, int a1, int a2, const CNStringR col, int width = -1);'
  1519. `void fill_arc(int x, int y, int w, int h, int a1, int a2, const CNStringR col);'
  1520. `void pie_arc(int x, int y, int w, int h, int a1, int a2, const CNStringR col);'
  1521. `void rectangle(int x, int y, int w, int h, const CNStringR col, int width = -1);'
  1522. `void fill_rectangle(int x, int y, int w, int h, const CNStringR col);'
  1523. `void text(int x, int y, const CNStringR text, const CNStringR col, const CNStringR font);'
  1524. `void text(int x, int y, int w, int h, CNString align, CNStringR text, CNStringR col, CNStringR font);'
  1525. `void bitmap(int x, int y, int w, int h, CNStringR filename, CNStringR color1 = "black", CNStringR color2 = "");'
  1526. `void bitmap(int x, int y, CNStringR filename, CNStringR color1 = "black", CNStringR color2 = "");'
  1527.      Basic drawing commands ( exact description see section `EZD' or
  1528.      EZD's man pages). The command's `(x,y)' coordinates determine the
  1529.      position in the object. For the position in the current drawing the
  1530.      object's coordinates `(ox,oy)' are added automatically.
  1531.  
  1532. `virtual void redraw();'
  1533.      Virtual redraw function ( has to be implemented by derived objects
  1534.      ).
  1535.  
  1536. 
  1537. File: cncl.info,  Node: EZDDrawing,  Next: EZDPushButton,  Prev: EZDObject,  Up: EZD Interface
  1538.  
  1539. EZDDrawing -- Interface to EZD Drawings
  1540. =======================================
  1541.  
  1542. SYNOPSIS
  1543. --------
  1544.  
  1545.    `#include <CNCL/EZDDrawing.h>'
  1546.  
  1547. TYPE
  1548. ----
  1549.  
  1550.    `CN_EZDDRAWING'
  1551.  
  1552. * Menu:
  1553.  
  1554. BASE CLASSES
  1555. ------------
  1556. * EZD::             Base Class for EZD Graphic Objects
  1557.  
  1558. DERIVED CLASSES
  1559. ---------------
  1560.  
  1561. RELATED CLASSES
  1562. ---------------
  1563. * EZDObject::       Interface to EZD Object
  1564. * EZDPushButton::   Interface to EZD Push-Button
  1565. * EZDWindow::       Interface to EZD Windows
  1566.  
  1567. DESCRIPTION
  1568. -----------
  1569.  
  1570. `EZDDrawing'
  1571. Constructors:
  1572. `EZDDrawing();'
  1573. `EZDDrawing(CNParam *param);'
  1574. `EZDDrawing(const CNString &name);'
  1575. `EZDDrawing(const CNString &name, const int x, const int y, const int w, const int h);'
  1576.      Sets this drawing to the current drawing. Its name is either
  1577.      `name' or (by default) "draw".
  1578.  
  1579.    Additional functions :
  1580.  
  1581. `void set();'
  1582.      sets this drawing to the current drawing.
  1583.  
  1584. 
  1585. File: cncl.info,  Node: EZDPushButton,  Next: EZDWindow,  Prev: EZDDrawing,  Up: EZD Interface
  1586.  
  1587. EZDPushButton -- Interface to EZD Push-Button
  1588. =============================================
  1589.  
  1590. SYNOPSIS
  1591. --------
  1592.  
  1593.    `#include <CNCL/EZDPushButton>'
  1594.  
  1595. TYPE
  1596. ----
  1597.  
  1598.    `CN_EZDPUSHBUTTON'
  1599.  
  1600. * Menu:
  1601.  
  1602. BASE CLASSES
  1603. ------------
  1604. * EZD::                 Base Class for EZD Graphic Objects
  1605.  
  1606. DERIVED CLASSES
  1607. ---------------
  1608.  
  1609. RELATED CLASSES
  1610. ----------------
  1611. * EZDObject::           Interface to EZD Objects
  1612. * EZDDrawing::          Interface to EZD Drawing
  1613. * EZDWindow::           Interface to EZD Window
  1614.  
  1615. DESCRIPTION
  1616. -----------
  1617.  
  1618. `EZDPushButton' defines a push-button in the current drawing. The
  1619. button is defined by it's minimum `(x,y)' coordinates, it's width `w'
  1620. by heigth `h' rectangle size and it's `CNNamed' object name. The
  1621. default values are x = y = 0, w = 50, h = 20, name = "button".The
  1622. button is drawn as a filled white rectangle with a black border. The
  1623. button's `text' is written in black characters in the center of the
  1624. button.
  1625. When the mouse enters a button with an action, the border is thickened.
  1626. When the mouse button 1 is pressed, the button colors are reversed.
  1627. Releasing mouse button 1 the push-button's `action' is taken and it is
  1628. drawn as before.
  1629. NOTE: If you leave the button's area with your mouse during
  1630. pressing/releasing the mouse button no `action' will be taken.
  1631. Constructors:
  1632. `EZDPushButton();'
  1633. `EZDPushButton(CNParam *param);'
  1634. `EZDPushButton(const CNString &name, int vx, int vy, int vw, int vh, const CNString &vtext);'
  1635. `EZDPushButton(const CNString &name, int vx, int vy, int vw, int vh, const CNString &vtext, const CNString &vaction);'
  1636.      Initializes the  push-button in the current drawing. `name' is the
  1637.      object's name (default: "button"), `(vx, vy)' the minimum (x,y)
  1638.      coordinates (default: (0,0)), `(vw, vh)' the button's width and
  1639.      heigth (50,20), `vtext' the describing text in the current drawing
  1640.      ("button") and `vaction' the action taken when the button is
  1641.      pressed ("log-event").
  1642. In addition to the member functions required by CNCL, `EZDPushButton'
  1643. provides:
  1644.  
  1645. `void set_text(const CNString &t);'
  1646.      Sets the push-button's text to t.
  1647.  
  1648.